<%-- 
    Document   : index
    Created on : Apr 26, 2013, 2:26:11 PM
    Author     : Jung Jin Hyuk
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="shortcut icon" href="resources/images/icon-viec-lam.ico" />	
        <link type="text/css" rel="stylesheet" href="resources/style/style.css">
        <title>Recruitment Process System</title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
        <link rel="stylesheet" href="/resources/demos/style.css" />
        <script>
            $(function() {
                $( "#datepicker" ).datepicker();
            });
       
            function phonenumber(t)  
            {  
                var phoneno = /^\d{10}$/;  
                if(t.value.match(phoneno))  
                {  
                    return true;  
                }  
                else  
                {  
                     alert("Not a valid Phone Number");
                    return false;  
                }  
            }  
                
            function Validate(){
                var emailID=document.frm.txtEmail
                var x=emailID.value
                var a=document.frm.txtAc.value
                if(a=="")
                {
                    alert("Please enter User Name");
                    document.frm.txtAc.focus();
                    return false;
                }
                 if(a.length <4)
                {
                    alert("Please enter User Name include 4->12 characters");
                    document.frm.txtAc.focus();
                    return false;
                }
                if(document.frm.txtPass.value=="")
                {
                    alert("Please enter Password");
                    document.frm.txtPass.focus();
                    return false;
                }
                if(document.frm.txtPass2.value=="")
                {
                    alert("Please enter Password");
                    document.frm.txtPass2.focus();
                    return false;
                }
                var p1=document.frm.txtPass.value
                var p2=document.frm.txtPass2.value
                if(p1!=p2)
                {
                    alert(" Password unlike");
                    document.frm.txtPass.focus();
                    return false;
                }
                if(p1.length <4)
                {
                    alert("Please enter Password include 4->12 characters");
                    document.frm.txtPass.focus();
                    return false;
                }
                if(p2.length <4)
                {
                    alert("Please enter Password include 4->12 characters");
                    document.frm.txtPass2.focus();
                    return false;
                }
                
                if (emailID.value==""){
                    alert("Please Enter your Email Address")
                    emailID.focus()
                    return false
                }
               
                var atpos=x.indexOf("@");
                var dotpos=x.lastIndexOf(".");
                if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
                {
                    alert("Not a valid e-mail address");
                    return false;
                }
                if(document.frm.txtFullname.value=="")
                {
                    alert("Please enter Fullname");
                    document.frm.txtFullname.focus();
                    return false;
                }
                if(document.frm.txtBirthday.value=="")
                {
                    alert("Please enter Birthday");
                    document.frm.txtBirthday.focus();
                    return false;
                }
                if(document.frm.txtGender.value=="")
                {
                    alert("Chose Gender");
                    document.frm.txtGender.focus();
                    return false;
                }
                if(document.frm.txtAddress.value=="")
                {
                    alert("Please enter Address");
                    document.frm.txtAddress.focus();
                    return false;
                }
                if(document.frm.txtPhone.value=="")
                {
                    alert("Please enter Phone");
                    document.frm.txtPhone.focus();
                    return false;
                }
                var ph=document.frm.txtPhone.value
                if(ph.length <9)
                {
                    alert("Please enter Phone include 10 characters");
                    document.frm.txtPhone.focus();
                    return false;
                }
                
                
                
                
            }
        
        </script>
    </head>
    <body>

        <!-- begin header-->
        <div id="header">
            <!-- begin top header-->
            <div id="line_top">
                <div class="container">
                    <p class="sovl">The number of jobs:<strong>7299</strong></p>
                    <c:set value="${username}" var="userName"></c:set>
                    <c:if test="${empty userName}">
                        <p class="submenu"><a href="#">Contact</a> | <a href="loginServlets">Sign in</a> | <a href="account">Sign up</a></p>
                    </c:if>    
                    <c:if test="${not empty userName}">
                        <p class="submenu">Welcome ${userName} | <a href="LogoutServlet">Log Out</a> | <a href="#">Contact</a>  </p>
                    </c:if>  
                </div>
            </div>
            <div id="top_header">
                <div class="container">
                    <img class="logo" src="resources/images/logo.jpg" />
                    <img class="adv" src="resources/images/banner1.jpg" />
                </div>
            </div>
            <!-- begin menu top-->
            <div id="nav">
                <div class="container">
                    <img class="home" src="resources/images/home.jpg" />
                    <ul>
                        <li ><a href="index.jsp">Home page</a></li>
                        <li><a href="#">Candidates</a></li> <!--Người tìm việc--->
                        <li><a href="#">Recruiters</a></li><!--Nhà tuyển dụng--->
                        <li><a href="#">Personnel supply</a></li><!--Cung ứng nhân sự--->
                    </ul>

                </div>
            </div>
        </div>
        <hr style="width: 1200px"/>

        <!-- begin content page-->
        <div id="content">
            <div class="container">
                <!-- begin slide images -->
                <hr style="width: 1200px"/>
                <!-- begin slide news-->
                <div id="slide_news">
                    <div class="sn_col">
                        <h2>Category</h2>
                        <div class="col_content">
                            <a href="#"><img src="resources/images/tailieu.jpg" /></a>
                            <p>For many young people, the biggest challenge facing the job interview ...</p>
                        </div>
                    </div>
                    <div class="sn_col">
                        <h2>Create Profile</h2>
                        <div class="col_content">
                            <a href="CreateProfile"><img src="resources/images/hoso.jpg" /></a>
                            <p>For many young people, the biggest challenge facing the job interview ...</p>
                        </div>
                    </div>
                    <div class="sn_col">
                        <h2>Work Informations</h2>
                        <div class="col_content">
                            <a href="PostRecruitmentServlet"><img src="resources/images/thongtin.jpg" /></a>
                            <p>For many young people, the biggest challenge facing the job interview ...</p>
                        </div>
                    </div>
                    <div class="sn_col">
                        <h2>Job Search Diary</h2>
                        <div class="col_content">
                            <a href="#"><img src="resources/images/nhatky.jpg" /></a>
                            <p>For many young people, the biggest challenge facing the job interview ...</p>
                        </div>
                    </div>
                </div>
               <hr style="width: 1200px"/>
                <!-- begin viec lam-->
                <div id="work">
                    <div CLASS="work1_top">
                        <h3> Search a job</h3>
                        <form action="SearchWork" method="POST">
                            <div class="search">
                                <select name="sCity" class="selectSearch">
                                    <option value="none">Choose Province/City</option><!-- Chọn Tỉnh Thành Phố-->
                                    <c:forEach items="${listWP}" var="wp">
                                        <option value="${wp.workplaceId}">${wp.workplaceName}</option>
                                    </c:forEach>                           
                                </select>
                                <select name="sCategory" class="selectSearch">
                                    <option value="none">Choose a Industry</option>
                                    <c:forEach items="${listC}" var="c">
                                        <option value="${c.categoryId}">${c.categoryName}</option>
                                    </c:forEach>                                                                             
                                </select>
                                <select name="sSalary" class="selectSearch">
                                    <option value="none">Choose Salary Grade</option>
                                    <option value="d1tr">Below 1000.000 vnd</option>
                                    <option value="1d5tr">1000.000->5000.000 vnd</option>
                                    <option value="5d8tr">5000.000->8000.000 vnd</option>
                                    <option value="8d10tr">8000.000->10.000.000 vnd</option>
                                    <option value="10d15tr">10.000.000->15.000.000 vnd</option>
                                    <option value="t15tr">Above 15.000.000 vnd</option>

                                </select>
                                <select name="sExp" class="selectSearch">
                                    <option value="none">Choose Year of Experience</option>
                                    <option value="0">None</option>
                                    <option value="1">1 year</option>
                                    <option value="2">2 years</option>
                                    <option value="3">3 years</option>
                                    <option value="4">4 years</option>
                                    <option value="5">5 years</option>
                                    <option value="6">Above 5 years</option>                                                      
                                </select>
                                <input type="submit" value="Search" name="sr" style="width: 100px;height: 30px;color: #0a81f7; margin-top: 5px;" />
                            </div>
                        </form>
                    </div>
                    <div CLASS="work1_mid">
                        <h4 style="text-align: center;color: red;font-size: 20px">  Register Account Information</h4>
                        <div class="viec">
                            <div class="dk">
                                <form name="frm" action="account" method="post" onsubmit=" return Validate()">
                                    <table style="margin:0 auto; padding: 30px ;width: 780px">
                                        <tr><td class="anh">Account Information</td></tr>

                                        <tr><td class="anh">&nbsp;</td></tr>
                                        <tr>                                      
                                            <td style="text-align: right;color: blue;width:250px">Account:</td>
                                            <td ><input type="text" name="txtAc" size="40px" value="${eror1}" maxlength="12"></td>
                                            <td colspan="2" style="color: red;float: left"><c:set value="${eror}" var="eror" ></c:set> ${eror}</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr> 
                                            <td style="text-align: right;color: blue;width:250px">Password:</td>
                                            <td><input type="password" name="txtPass" size="40px"  maxlength="12"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr> 
                                            <td style="text-align: right;color: blue;width:250px">Re-Password:</td>
                                            <td><input type="password" name="txtPass2" size="40px"  maxlength="12"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr>
                                        <tr>
                                            <td style="text-align: right;color: blue;width:250px">Email:</td>
                                            <td><input type="text" name="txtEmail" size="40px" value="${eror2}"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr>
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr><td class="anh">Personal Information</td></tr>
                                        <tr>                                 
                                            <td style="text-align: right;color: blue;width:250px">Full Name:</td>
                                            <td><input type="text" name="txtFullname" size="40px" value="${eror3}"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr> 
                                            <td style="text-align: right;color: blue;width:250px">Birthday:</td>
                                            <td><input type="text" id="datepicker" name="txtBirthday" size="25px" value="${eror4}"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr>
                                            <td style="text-align: right;color: blue;width:250px">Gender:</td>
                                            <td><select name="txtGender">                                              
                                                    <option >Male</option>
                                                    <option >Female</option>
                                                </select></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr>
                                            <td style="text-align: right;color: blue;width:250px">Address:</td>
                                            <td><input type="text" name="txtAddress" size="40px" value="${eror5}"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr>
                                            <td style="text-align: right;color: blue;width:250px">Phone:</td>
                                            <td><input type="text" name="txtPhone" size="40px" value="${eror6}"  maxlength="10"></td>
                                            <td colspan="2">&nbsp</td> 
                                        </tr> 
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr><td class="anh">&nbsp</td></tr>
                                        <tr>
                                            <td style="text-align: center;"colspan="2">
                                                <input type="submit" name="sm" value="Register" style="color: blue" >
                                                <input type="reset" name="rs" value="Reset" style="color: blue">
                                            </td>
                                        </tr> 
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div CLASS="work1_bot">   
                        <h5> Advertisement</h5>
                        <div class="quangcao">
                            <a href="#"><img src="resources/images/quangcao.gif" style="width: 200px" /></a>                       
                            <a href="#"><img src="resources/images/quangcao3.png" style="width: 200px;height: 240px" /></a>
                            <a href="#"><img src="resources/images/quangcao.png" style="width: 200px;height: 200px" /></a>
                        </div>
                    </div>
                </div>
            </div>

            <div id="footer">
                <h6>@copyright FPT Aptech</h6>
                <h6>Email: quangcao@c1104g.g1.vn</h6>
                <h6> Tel: 844 39748899 Ext:2222 </h6>
                <h6>Website: www.c1104g-g1.vn</h6>
            </div>

    </body>
</html>
